home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
CD Playthrough 1.5.sit
/
CD Playthrough 1.5
/
Source
/
main.h
< prev
next >
Wrap
Text File
|
1996-11-20
|
3KB
|
116 lines
// CD Playthrough
// Version: 1.5 <October 3, 1994>
// (c) 1994 neg.active.productions, jwang@csua.berkeley.edu <James Wang>
// ftp://ftp.csua.berkeley.edu/pub/jwang/cool/cd-playthrough-15.hqx
// File: main.h
//
// Contains: C header file with project definitions
//
// Written by: James Wang
//
// Description: Project constants, data struction definitions,
// and functional prototypes are included here.
#include <Components.h>
#include <Resources.h>
#include <Sound.h>
#include <SoundInput.h>
// It might be necessary to comment out these definitions depending
// upon which set of include files are being used. -- Gary Anwyl
typedef unsigned long UnsignedFixed; // unsigned fixed-point number
#undef ComponentCallNow
#define ComponentCallNow(callNumber, paramSize) ¥
{0x2f3c, paramSize, callNumber, 0x7000, 0xA82A}
#include "SoundComponents.h"
// Preserve ordering of block above for SoundComponents.h. --jwang
// ALRT resource ID
#define kStopAlertID 128
#define kCautionAlertID 129
// PREF resource ID
#define kSourPrefID 128
#define kPlthPrefID 129
#define kRatePrefID 130
// STR# resource ID
#define kSourStrID 128
#define kPlthStrID 129
#define kErrMessageID 130
// Error Message STR# index
#define DiskError 1
#define MemFull 2
#define ResError 3
#define siReadDevFailed 4
#define siWriteDevFailed 5
#define siGetDevInfoFailed 6
#define siSetDevInfoFailed 7
#define GetCompInfoFailed 8
#define OpenCompFailed 9
#define soCompNotFound 10
#define soGetCompInfoFailed 11
#define soSetCompInfoFailed 12
#define soRateNotAvailable 13
// key codes
#define kcCmd 0x37
#define kcCtrl 0x3b
// CD Playthrough constants
#define kSourMic 1 // microphone
#define kSourCD 2 // internal CD
#define kSourAV 3 // AV monitor connector
#define kPlthMin 0 // playthrough off
#define kPlthMax 7 // playthrough full blast
#define kRate22050 (22050L<<16)
#define kRate24000 (24000L<<16)
#define kRate44100 (44100L<<16)
#define kRate48000 (48000L<<16)
typedef struct {
short count;
UnsignedFixed **rates;
} SRCInfoStruct; // sound rate component info struct
typedef struct {
short siCurrSour; // current sound in source
short siWantSour; // desired sound in source
short siCurrPlth; // current sound in playthrough level
short siWantPlth; // desired sound in playthrough level
UnsignedFixed soCurrRate; // current sound out rate
UnsignedFixed soWantRate; // desired sound out rate
} SoundSetting;
void get_sound_in(SoundSetting *mySnd);
void set_sound_in(SoundSetting *mySnd);
void get_sound_out(SoundSetting *mySnd);
void set_sound_out(SoundSetting *mySnd);
void open_sdev_component(ComponentInstance *compInst);
Boolean desired_rate_available(UnsignedFixed myWantRate);
void res_check(SoundSetting *mySnd);
void read_prefs(SoundSetting *mySnd);
void save_prefs(SoundSetting *mySnd);
void system_prefs(SoundSetting *mySnd);
void init_all(void);
void stop_alert(short id);
void handle_res_error(short err);
Boolean is_pressed(unsigned short k);
void main(void);